﻿using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using WeifenLuo.WinFormsUI.Docking;
namespace GameEditor.Common
{
    public class Window
    {
        private bool isHidden;
        private DockState dockState;
        private string uniqueName;
        private bool hideOnClose;


        [XmlAttribute]
        public bool IsHidden
        {
            get { return isHidden; }
            set { isHidden = value; }
        }
        [XmlAttribute]
        public DockState DockState
        {
            get { return dockState; }
            set { dockState = value; }
        }
        [XmlAttribute]
        public string UniqueName
        {
            get { return uniqueName; }
            set { uniqueName = value; }
        }

        [XmlAttribute]
        public bool HideOnClose
        {
            get { return hideOnClose; }
            set { hideOnClose = value; }
        }


    }

    public class Layout
    {

        private bool showInMenu = false;
        private System.Collections.ArrayList windows = new System.Collections.ArrayList();
        //[XmlArrayItem(typeof(Window))]
        [XmlElement(typeof(Window))]
        public System.Collections.ArrayList Windows
        {
            get { return windows; }
            set { windows = value; }
        }

        [XmlAttribute]
        public bool ShowInMenu
        {
            get { return showInMenu; }
            set { showInMenu = value; }
        }
    }
    public interface ILayoutManager
    {
        void Apply(string name);
        void Remove(string name);
        /// <summary>
        /// save current layout to local disk
        /// </summary>
        /// <param name="name"></param>
        void SaveAs(string name);
        IEnumerable<KeyValuePair<string, Layout>> Layouts
        {
            get;
        }
        /// <summary>
        /// save the named layout
        /// </summary>
        /// <param name="name"></param>
        void SaveNamedLayout(string name);
        bool RequestRename(string oldName, string newName);
        Layout Find(string name);
    }
}
